package com.zmm.zebulon.module.crm.dal.mysql.customer;

import com.zmm.zebulon.common.pojo.PageResult;
import com.zmm.zebulon.module.crm.controller.admin.customer.vo.limitconfig.CrmCustomerLimitConfigPageReqVO;
import com.zmm.zebulon.module.crm.dal.dataobject.customer.CrmCustomerLimitConfigDO;
import com.zmm.zebulon.starter.mybatis.mybatis.core.mapper.BaseMapperX;
import com.zmm.zebulon.starter.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import org.apache.ibatis.annotations.Mapper;

/**
 * description: 客户限制配置 Mapper
 *
 * @author zebulon
 * package com.zmm.zebulon.module.crm.dal.mysql.customer
 * name: CrmCustomerLimitConfigMapper
 * date 2024/1/12 23:19
 */
@Mapper
public interface CrmCustomerLimitConfigMapper extends BaseMapperX<CrmCustomerLimitConfigDO> {

    default PageResult<CrmCustomerLimitConfigDO> selectPage(CrmCustomerLimitConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CrmCustomerLimitConfigDO>()
                .eqIfPresent(CrmCustomerLimitConfigDO::getType, reqVO.getType())
                .orderByDesc(CrmCustomerLimitConfigDO::getId));
    }

}
